<?php declare(strict_types=1);
/**
 * @author      xianganyall <xianganyall@gmail.com>
 * @copyright   2023-2025 owner
 **/

namespace Srv\Conf\ConfModel;

use Srv\Libs\ConfModel\ConfAbstract;

final class AppleAuthConf extends ConfAbstract
{
    public const PREFIX                         = 'APPLEAUTH.';         // 配置前缀[必定点结尾]
    private string $groupName                   = '';                   // 分组名
    protected string $appleBundleId             = '';                   // Apple-BundleId
    protected string $appId                     = '';                   // Apple-appId
    protected string $issId                     = '';                   // Apple-issId
    protected string $keyId                     = '';                   // Apple-kId AuthKey文件的KId
    protected string $authKeyFile               = '';                   // Apple-AuthKeyFile AuthKey文件[.p8]
    protected string $rootCaCerFile             = '';                   // 苹果CA根证书 https://www.apple.com/certificateauthority/AppleRootCA-G3.cer

    /**
     * @param array $confData
     * @param string $groupName
     */
    public function __construct(array $confData, string $groupName)
    {
        $this->init($confData);
        $this->groupName = $groupName;
    }

    /**
     * @return string
     */
    public function getGroupName(): string
    {
        return $this->groupName;
    }

    /**
     * @return string
     */
    public function getAppleBundleId(): string
    {
        return $this->appleBundleId;
    }

    /**
     * @return string
     */
    public function getAppId(): string
    {
        return $this->appId;
    }

    /**
     * @return string
     */
    public function getIssId(): string
    {
        return $this->issId;
    }

    /**
     * @return string
     */
    public function getKeyId(): string
    {
        return $this->keyId;
    }

    /**
     * @return string
     */
    public function getAuthKeyFile(): string
    {
        return $this->authKeyFile;
    }

    /**
     * @return string
     */
    public function getRootCaCerFile(): string
    {
        return $this->rootCaCerFile;
    }
}